home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS12.ADF
/
AmigaBBS
/
sysop
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1986-08-05
|
9KB
|
248 lines
ERASE ABCS$:DIM ABCS$(185)
ON BREAK GOSUB Teflon
BREAK ON
yeller=0:teetse=1
Main:
GOSUB Sysop
CHAIN "df0:Menus",20,ALL
Modem:
IF rings=0 THEN OtherModem
x=FRE(0)
FOR j= 1 TO LEN(a$):p$=MID$(a$,j,1)
PRINT p$;:PRINT#1,p$;:NEXT j
a$="":p$="":RETURN
OtherModem:
x=FRE(0)
FOR j= 1 TO LEN(a$):p$=MID$(a$,j,1)
PRINT p$;:NEXT j
a$="":p$="":RETURN
Answers:
telly=0:t$="":t=0:i$="":ch$="":alter=0:IF rings=0 THEN SomeAnswers
WHILE 1 AND alter<1
WHILE LOC(1)<>0
ch$=INPUT$(1,1)
equivs=ASC(ch$) AND 127:IF equivs<>1 THEN ch$=CHR$(equivs)
i$=i$+ch$:equivs=0
telly=telly+1:IF telly=78 THEN ch$=r$:telly=0
IF ch$=CHR$(8) AND LEN(i$)>=2 THEN i$=LEFT$(i$,LEN(i$)-2):telly=telly-1
IF ch$=CHR$(10) OR ch$=CHR$(13) OR ch$=r$ THEN alter=3:telly=0
a$=ch$:GOSUB Modem:ch$=""
WEND
ch$=INKEY$:i$=i$+ch$
a$=ch$:GOSUB Modem
IF ch$=CHR$(10) OR ch$=CHR$(13) OR ch$=r$ THEN telly=0:GOTO MoreAnswers
IF ch$=CHR$(8) AND LEN(i$)>=2 THEN i$=LEFT$(i$,LEN(i$)-2)
ch$="":IF LEN(i$)=0 THEN connect=PEEK (&Hbfd*&H1000+&H0):IF connect<>0 THEN okp=0:RETURN
WEND
IF i$<>"" THEN MoreAnswers
SomeAnswers:
ch$=INKEY$:i$=i$+ch$:a$=ch$:GOSUB Modem
IF ch$= CHR$(10) OR ch$=CHR$(13) OR ch$=r$ THEN MoreAnswers
IF ch$=CHR$(8) AND LEN(i$)>=2 THEN i$=LEFT$(i$,LEN(i$)-2)
ch$=""
GOTO SomeAnswers
MoreAnswers:
IF okp<>1 THEN RETURN
IF i$="" THEN ch$="":GOTO Answers
t$=i$:IF LEN(t$)>80 THEN t$=LEFT$(t$,78)+r$
RETURN
SeqRead:
ERASE ABCS$:DIM ABCS$(185)
a$=r$+r$+"[> K Quits <]"+r$+r$:GOSUB Modem
OPEN "I", #3, file$
ReadSeq:
j=0:L=0:k=0:Countl=0
WHILE NOT EOF(3)
x=FRE(0):j=j+1
LINE INPUT#3,ABCS$(j):ABCS$(j)=ABCS$(j)+r$
WEND
CLOSE#3:k=j:L=0:Detect=0
WHILE L<k
L=L+1:a$=ABCS$(L):GOSUB Modem
CheckSeq:
t$="":t=0:i$="":ch$="":IF rings=0 THEN SomeCheckSeq
WHILE LOC(1)<>0
ch$=INPUT$(1,1):equivs=ASC(ch$) AND 127:IF equivs<>1 THEN ch$=CHR$(equivs)
i$=i$+ch$:equivs=0:a$=ch$:GOSUB Modem
WEND
IF i$<>"" THEN MoreCheckSeq
SomeCheckSeq:
ch$=INKEY$:i$=i$+ch$:a$=ch$:GOSUB Modem
OtherCheckSeq:
IF Detect=1 GOTO MoreCheckSeq
Countl=Countl+1:IF Countl=24 THEN a$=r$+"More (y,n,c)?":GOSUB A1
IF Countl=24 THEN MenS$=UCASE$(LEFT$(t$,1)):IF MenS$="N" THEN L=k+1
IF Countl=24 AND MenS$="Y" THEN Countl=0
IF Countl=24 AND MenS$="C" THEN Detect=1
IF Countl=24 AND Detect<>1 THEN Countl=0
MoreCheckSeq:
IF i$=CHR$(75) OR i$=CHR$(107) THEN L=k+1
WEND
ERASE ABCS$:DIM ABCS$(185):RETURN
A1:
GOSUB Modem:GOSUB Answers:RETURN
CheckConTime:
Contime$=TIME$:ChEntTime$=RIGHT$(Enttime$,5):Contime$=RIGHT$(Contime$,5)
Contime=VAL(Contime$):Enttime=VAL(ChEntTime$)
IF Contime-Enttime>30 AND Veru$="000" THEN okp=0:RETURN
IF Contime-Enttime>45 AND Veru$="007" THEN okp=0:RETURN
okp=1:RETURN
Sysop:
10 IF okp<>1 AND yeller=0 THEN RETURN
IF okp<>1 AND yeller=1 THEN CHAIN "df0:menus",20,ALL
GOSUB CheckConTime:IF okp<>1 AND yeller=0 THEN RETURN
IF okp<>1 AND yeller=1 THEN CHAIN "df0:menus",20,ALL
a$=r$+"SysMain:":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="E" THEN EditFile
IF MenS$="U" THEN yeller=1:CHAIN "df0:usermaint",,ALL
IF MenS$="T" THEN Terminal
IF MenS$="X" AND yeller=0 THEN RETURN
IF MenS$="X" AND yeller=1 THEN CHAIN "df0:Menus",20,ALL
IF MenS$="?" THEN file$="df1:SysopMenu":GOSUB SeqRead:GOTO Sysop
a$=r$+"No Such Command!"+r$:GOSUB Modem:GOTO Sysop
EditFile:
IF okp<>1 THEN RETURN
GOSUB CheckConTime:IF okp<>1 THEN RETURN
a$=r$+"FEdit:":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="E" THEN EditDoc
IF MenS$="D" THEN DeleteDoc
IF MenS$="C" THEN CreateDoc
IF MenS$="X" THEN Sysop
IF MenS$="?" THEN file$="df1:EdSysMenu":GOSUB SeqRead:GOTO EditFile
a$=r$+"No Such Command!"+r$:GOSUB Modem:GOTO Sysop
EditDoc:
a$=r$+"FileName:":GOSUB A1:file$=LEFT$(t$,LEN(t$)-1):Ddt=0:GOSUB SeqRead
RequestEditDoc:
a$=r$+"S- Save I- Insert Line D- Delete Line L- List R- Replace X- Exit:":GOSUB A1
MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="S" THEN SaveEditDoc
IF MenS$="I" THEN InsertEditDoc
IF MenS$="D" THEN DeleteEditDoc
IF MenS$="L" THEN ListEditDoc
IF MenS$="R" THEN ReplaceEditDoc
IF MenS$="X" THEN EditFile
a$=r$+"No Such Command!":GOTO RequestEditDoc
SaveEditDoc:
OPEN "O",#4, file$
FOR j=1 TO Ddt
PRINT#4,ABCS$(j)
NEXT j
CLOSE#4
GOTO Sysop
InsertEditDoc:
IF Ddt>=199 THEN a$=r$+"No room to insert.":GOSUB Modem:GOTO RequestEditDoc
a$=r$+"Insert before which line:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN RequestEditDoc
instln=VAL(t$)
FOR j=Ddt TO instln STEP -1
ABCS$(j+1)=ABCS$(j)
NEXT j
ABCS$(instln)=" "+r$:Ddt=Ddt+1
GOTO RequestEditDoc
DeleteEditDoc:
a$=r$+"Delete starting which line:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN RequestEditDoc
stln=VAL(t$):IF stln<1 OR stln>Ddt THEN RequestEditDoc
a$=r$+"Ending which line:":GOSUB A1:endtln=VAL(t$):IF endtln>Ddt THEN endtln=Ddt
IF stln>endtln THEN SWAP stln,endtln
a$=r$+"Delete from"+STR$(stln)+" to"+STR$(endtln)+r$+"Are you sure? (Y or N):":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="N" THEN RequestEditDoc
FOR j=endtln+1 TO Ddt
ABCS$(j-((endtln+1)-stln))=ABCS$(j)
NEXT j
Ddt=Ddt-((endtln+1)-stln)
FOR j=Ddt TO Ddt+((endtln+1)-stln)
ABCS$(j)=" "+r$
NEXT j
GOTO RequestEditDoc
ListEditDoc:
a$=r$+"Line to start at:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN RequestEditDoc
stln=VAL(t$):IF stln<1 OR stln>Ddt THEN RequestEditDoc
a$=r$+"Line to stop at:":GOSUB A1:endtln=VAL(t$)+3:IF endtln<stln THEN RequestEditDoc
IF endtln>Ddt THEN endtln=Ddt
FOR L=stln TO endtln
a$=r$+STR$(L)+":"+ABCS$(L):GOSUB Modem
NEXT L
GOTO RequestEditDoc
ReplaceEditDoc:
a$=r$+"Replace which line:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN RequestEditDoc
rplnn=VAL(t$):IF rplnn<1 OR rplnn>Ddt THEN RequestEditDoc
a$=r$+"Replace:"+ABCS$(rplnn)+"With:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN RequestEditDoc
Temprep$=t$
a$=r$+"Replace:"+ABCS$(rplnn)+"With:"+Temprep$+"(Y or N):":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="Y" THEN ABCS$(rplnn)=Temprep$
GOTO RequestEditDoc
DeleteDoc:
a$=r$+"File to delete:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN EditFile
file$=LEFT$(t$,LEN(t$)-1)
a$=r$+"Delete "+file$+r$+"Are you Sure? (Y or N):":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="Y" THEN KILL file$
GOTO EditFile
CreateDoc:
a$=r$+"Filename:":GOSUB A1:IF t$=CHR$(10) OR t$=CHR$(13) THEN EditFile
file$=LEFT$(t$,LEN(t$)-1)
ABCS$(1)="Time:"+TIME$+" "+"Date:"+DATE$+r$
a$=r$+"Subject:":GOSUB A1:Subject$=LEFT$(t$,LEN(t$)-1)
IF LEN(Subject$)>30 THEN Subject$=LEFT$(Subject$,30)
ABCS$(2)="Name:"+LEFT$(Name1$,LEN(Name1$)-1)+LEFT$(Name2$,LEN(Name2$)-1)+" Subject:"+Subject$+" UserID:"+UserID$
ABCS$(3)=r$:Dzz=0:Ddt=3
a$=r$+"Enter Text: [Max. 197 lines] /EX to Exit"+r$:GOSUB Modem
WHILE Dzz<1
Ddt=Ddt+1
a$=r$+STR$(Ddt-3)+":":GOSUB A1:ABCS$(Ddt)=t$
IF UCASE$(LEFT$(t$,3))="/EX" THEN Dzz=1:Ddt=Ddt-1
IF Ddt=199 THEN a$=r$+"Last Line!":GOSUB Modem
IF Ddt=200 THEN Dzz=1
WEND
QueryCreateFile:
a$=r$+"S- Save E- Edit C- Continue:":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="S" THEN SaveEditDoc
IF MenS$="E" THEN EditFile
IF MenS$="C" THEN ContinueFile
a$=r$+"No such command.":GOSUB Modem:GOTO QueryCreateFile
ContinueFile:
IF Ddt>198 THEN a$=r$+"No Room!":GOTO QueryCreateFile
Dzz=0
a$=r$+"Enter Text: [Max. 197 lines] /EX to Exit"+r$:GOSUB Modem
WHILE Dzz<1
Ddt=Ddt+1
a$=STR$(Ddt-3)+":":GOSUB A1:ABCS$(Ddt)=t$
IF UCASE$(LEFT$(t$,3))="/EX" THEN Dzz=1:Ddt=Ddt-1
IF Ddt=199 THEN a$=r$+"Last Line!":GOSUB Modem
IF Ddt=200 THEN Dzz=1
WEND
GOTO QueryCreateFile
Terminal:
ltomr=0:teetse=0:a$=r$+"\ to exit"+r$:GOSUB Modem
WHILE ltomr<1
WHILE LOC(1)<>0
PRINT INPUT$(1,1);
WEND
i$=INKEY$:IF i$="\" THEN ltomr=3
IF i$<>"" THEN PRINT #1,i$;
WEND
GOTO Sysop
Teflon:
IF teetse=1 THEN a$=r$+"Sorry, not allowed.":GOSUB Modem:RETURN
IF teetse=0 THEN ltomr=1:teetse=1:RETURN
RETURN